<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class user{
            constructor (name){
                this.name=name;
            }
        }

        class Admin extends user{
            constructor(name){
                super(name); //使用构造函数，而且继承父类就必须使用super
                this.name=name;//如果有变量的话，就要把super写道this之前,和java一样
            }
            show(){
                console.log(this.name);
            }
        }
        let a= new Admin("唐玮");
        a.show();

    </script>
</body>
</html>